<template>
	<view class="classifyList">
		<headerTitle :title="title" v-if="!hideTitle"></headerTitle>
		<view class="classifyListBody">
			<block v-for="(classifItem,classifyIndex) in classifyListData" :key="classifyIndex" v-if="classifyListData.length>0">
				<classify-item :classifyItemData="classifItem" style="width: 50%;height: 100%;" @click="goMenuInfo"></classify-item>
			</block>
			<block v-if="classifyListData.length===0">
				<view class='noCard'>
					暂无菜谱
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	import headerTitle from './headerTitle.vue'
	import classifyItem from './classifyItem.vue'
	import {
		goMenuInfoMethods
	} from '../util/mixins.js'
	export default {
		mixins: [goMenuInfoMethods],
		components: {
			headerTitle,
			classifyItem
		},
		data() {
			return {

			};
		},
		props: {
			title: {
				type: String,
				default: '肉菜菜谱'
			},
			classifyListData: {
				type: Array,
				default: {}
			},
			hideTitle: {
				type: Boolean,
				default: false
			}
		}
	}
</script>

<style lang="scss">
	.classifyList {
		background-color: #FFFFFF;
		min-height: 40vh;

		.classifyListBody {
			padding: 0upx 20upx;
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;

		}

		.noCard {
			width: 90%;
			height: 200upx;
			margin: auto;
			margin-top: 40px;
			background-color: white;
			display: flex;
			align-items: center;
			justify-content: center;
			color: #999999;
			box-shadow: 0 0 10upx 0 rgba(0, 0, 0, 0.10);
			border-radius: 10upx;
		}
	}
</style>
